/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pojo;

import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author pvhuy
 */
@Entity
@Table(name=NhaSanXuat.TABLE_NHASANXUAT)
public class NhaSanXuat extends Base {
    public static final String TABLE_NHASANXUAT = "NhaSanXuat";

    protected static final String COLUMN_TENNHASANXUAT  = "TenNhaSanXuat";
    private static final int LENGTH_TENNHASANXUAT = 45;
    @Column(name=COLUMN_TENNHASANXUAT, length=LENGTH_TENNHASANXUAT, nullable=false)
    private String tenNhaSanXuat;

    @OneToMany(mappedBy="nhaSanXuat", cascade=CascadeType.ALL)
    private List<SanPham> danhSachSanPham;

    /**
     * @return the tenNhaSanXuat
     */
    public String getTenNhaSanXuat() {
        return tenNhaSanXuat;
    }

    /**
     * @param tenNhaSanXuat the tenNhaSanXuat to set
     */
    public void setTenNhaSanXuat(String tenNhaSanXuat) {
        this.tenNhaSanXuat = tenNhaSanXuat;
    }

    /**
     * @return the danhSachSanPham
     */
    public List<SanPham> getDanhSachSanPham() {
        return danhSachSanPham;
    }

    /**
     * @param danhSachSanPham the danhSachSanPham to set
     */
    public void setDanhSachSanPham(List<SanPham> danhSachSanPham) {
        this.danhSachSanPham = danhSachSanPham;
    }
}
